<template>
	<view class="content">
		<view class="item" v-for="(item,index) in list" :key="index">
			<!-- 当传入的参数是0为图片，否则为视频 -->
			<view class="">
				<image :src="$imageOss(item.image)" mode="widthFix" class="image" @tap.stop="toDetails(item)"></image>
				<text class="overGame" v-if="metType == 0&&url!='/pages/home/stadiumDetail'">{{item.test||''}}</text>
			</view>
			<image src="@/static/index/video.png" v-if="metType != 0" class="icon" mode="widthFix"
				@tap.stop="toDetails(item)"></image>
			<!-- <view class="" v-else>
				<video :src="item.link" class="image"></video>
			</view> -->
			<text>{{item.title}}</text>
			<view class="subInfo" v-if="isAddress">
				<text>{{item.site ||''}}个活动室</text>
				<view class="" style="display: flex;">
					<u-icon name="map-fill" size="13"></u-icon>
					<text>{{item.address||''}}</text>
				</view>
			</view>
			<view class="subInfo" v-if="metType != 0">
				<u-text :text="item.msg" lines="1" line-height="40rpx" size="26rpx" />
				<!-- <text >{{item.msg ||''}}</text> -->
				<text>{{$TimeFormat(new Date(item.createtime),'yyyy-mm-dd hh:MM:ss') || ''}}</text>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		props: {
			'list': {
				default: [],
				type: Array
			},
			metType: { //媒体类型
				type: Number,
				default: 0,
			},
			isAddress: {
				type: Boolean,
				default: false,
			},
			url:{
				default: '',
				type: String
			}
		},
		data() {
			return {

			};
		},
		onShow() {

		},
		methods: {
			toDetails(e) {
				if (this.metType != 0) {
					console.log(e.type,'eeeee')
					if(e.type != '1'){
						uni.navigateTo({
							url: '/pages/home/webview/webview?url=' + e.link
						})
					}else{
						uni.navigateTo({
							url: `/pages/home/watchDetails?id=${e.id}`
						})
					}
				} else {
					uni.navigateTo({
						url: `${this.url}?id=` + e.id
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		font-size: 28rpx;
		flex-wrap: wrap;
		justify-content: space-between;

		.item {
			width: 48%;
			display: flex;
			flex-direction: column;
			position: relative;
			margin-bottom: 20rpx;

			.icon {
				width: 32rpx !important;
				height: 32rpx !important;
				position: absolute;
				top: 22%;
				left: 45%;
			}

			.image {
				width: 100%;
				margin-bottom: 12rpx;
				border-radius: 20rpx;
				height: 168rpx !important;
			}

			.overGame {
				border-radius: 5px;
				background: rgba(0, 0, 0, 0.70);
				padding: 6rpx 12rpx;
				top: 15rpx;
				color: #FFF;
				font-size: 24rpx;
				font-style: normal;
				font-weight: 500;
				position: absolute;
				top: 14rpx;
				left: 16rpx;
			}

			.subInfo {
				display: flex;
				flex-direction: column;
				color: #909090;
				font-family: PingFang SC;
				font-style: normal;
				font-weight: 400;
				line-height: normal;

				/deep/ .u-icon {
					margin-top: 6rpx;
					align-items: flex-start;
				}

				text {
					margin-top: 10rpx;
					margin-left: 4rpx;
					font-size: 24rpx;
				}
			}
		}
	}
</style>